﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UiManager
{
	private static UiManager instance = new UiManager();

	public static UiManager getInsance()
	{
		return instance;
	}

	private Dictionary<string, UiScript> uiCatch = new Dictionary<string, UiScript>();

	public void add(UiScript ui)
	{
		this.uiCatch.Add(ui.getPath(), ui);
	}

	public void remove(UiScript ui)
	{
		this.uiCatch.Remove(ui.getPath());
	}

	public GameObject getUiGameObject(string path)
	{
		UiScript ui = this.uiCatch[path];
		if (ui != null)
		{
			return ui.gameObject;
		}
		return null;
	}
}
